package com.cloudsubassemblykafka10024;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.annotation.KafkaListeners;
import org.springframework.messaging.handler.annotation.SendTo;

import java.io.IOException;

@SpringBootApplication
public class CloudSubassemblyKafka10024Application {

    public static void main(String[] args) throws IOException {
        SpringApplication.run(CloudSubassemblyKafka10024Application.class, args);
        System.in.read();
    }


    @KafkaListeners(value = {
            @KafkaListener(topics = {"messageDML001"})
    })
    public void recevice01(ConsumerRecord<String, String> message) {
        System.out.println("Received message: " + message);
    }


//    @KafkaListeners(value = {
//            @KafkaListener(topics = {"messageDML002"})
//    })
//    @SendTo("messageDML003")
//    public String recevice02(ConsumerRecord<String, String> message) {
//        return message.value() + "我爱学习Kafka";
//    }
}
